To achieve the objective with perfect success (1880+)
Idioms and Phrases with work like a charm
work like a charm
Function very well, have a good effect or outcome, as in That knife-sharpener works like a charm, or Her deferential manner worked like a charm; he agreed to everything they'd asked for. This expression uses charm in the sense of “a magic spell.” [ Mid-1800s ]